package com.ly.aicode.core.saver;

import com.ly.aicode.ai.model.MultiFileCodeResult;
import com.ly.aicode.model.enums.CodeGenTypeEnum;

/**
 * @author luyi
 * @date 2025/11/9 0:14
 */
public class MultiCodeFileSaveTemplate extends CodeFileSaveTemplate<MultiFileCodeResult> {
    @Override
    protected CodeGenTypeEnum genTypeEnum() {
        return CodeGenTypeEnum.MULTI_FILE;
    }

    @Override
    protected void saveFile(MultiFileCodeResult result, String dirPath) {
        writeToFile(result.getHtmlCode(), "index.html", dirPath);
        writeToFile(result.getCssCode(), "style.css", dirPath);
        writeToFile(result.getJsCode(), "script.js", dirPath);
    }
}
